package com.woniu.service.impl;

import com.woniu.adapter.WorkerAdapter;
import com.woniu.outlet.po.WorkerPo;
import com.woniu.service.WorkerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class WorkerServiceImpl implements WorkerService {

    @Autowired
    private WorkerAdapter workerAdapter;

    @Override
    public List<WorkerPo> findWorkers() throws Exception {
        List<WorkerPo> workers = workerAdapter.findWorkers();
        return workers;
    }

    @Override
    public WorkerPo getWorkerById(Long id) throws Exception {
        return workerAdapter.getWorkerById(id);
    }

    @Override
    public Long getWorkerByCode(String code) {
        return workerAdapter.getWorkerByCode(code);
    }


    @Override
    public String getWorkerByAccount(String account) {

        return workerAdapter.getWorkerByAccount(account);
    }
}
